package definite.Guide.Book.MVC;

import java.awt.Container;
import java.awt.EventQueue;

import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.text.Document;

public class ShareModel {

	public static void main(String[] args) {
		Runnable runnable = new Runnable() {

			@Override
			public void run() {
				JFrame frame = new JFrame("Share Model Example");
				frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

				Container contentPane = frame.getContentPane();

				JTextArea textArea1 = new JTextArea();
				Document document = textArea1.getDocument();
				JTextArea textArea2 = new JTextArea(document);
				JTextArea textArea3 = new JTextArea(document);

				contentPane.setLayout(new BoxLayout(contentPane,
						BoxLayout.Y_AXIS));
				contentPane.add(new JScrollPane(textArea1));
				contentPane.add(new JScrollPane(textArea2));
				contentPane.add(new JScrollPane(textArea3));

				frame.setSize(300, 200);
				frame.setLocationRelativeTo(null);
				frame.setResizable(false);
				frame.setVisible(true);
			}
		};

		EventQueue.invokeLater(runnable);
	}

}
